<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/30
 * Time: 10:31
 */
namespace application\test;

class test1{
    public $reload;
    public $num;
    protected $type;
    protected $createNum;

    public function __construct()
    {

        $a = func_get_args();
        $i = func_num_args();
        if(count($a)==0) echo "初始化构造函数<br>";
//        print_r($a);

        if(method_exists($this,$f = "__construct".$i)) call_user_func_array(array($this,$f),$a);

    }

    public function __construct1($num)
    {
        $this->num = $num;
    }

    public function __construct2($type,$num)
    {
        $this->type = $type;
        $this->num = $num;
        echo "我被执行了<br>";
    }

    public function createBill($num=null){
        echo "Are you crazy? <br>";
        echo "订单创建成功，订单编号: ".$num;

    }

    protected function createSecretNum(){
        $ran = rand(100000,999999);
        return date("YmdHis").$ran;
    }

}